﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Windows.Forms;
using NKnife;
using NKnife.IoC;

namespace InfoboardAdapterC
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //获取当前进程的ID  
            var pId = Process.GetCurrentProcess().Id;
            var pName = Process.GetCurrentProcess().ProcessName;
            var isRun = Process.GetProcessesByName(pName).Any(p => pId != p.Id);
            if (isRun)
            {
                Application.Exit();
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Global.Culture = "zh-CN";
            DI.Initialize();
            Application.Run(new MainRun());
        }
    }
}
